<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.10"/>
<title>Introduction_to_Algorithms: IntrodunctionToAlgorithm::GraphAlgorithm::MatrixGraph&lt; N &gt; Struct Template Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { init_search(); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">Introduction_to_Algorithms
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.10 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('struct_introdunction_to_algorithm_1_1_graph_algorithm_1_1_matrix_graph.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#pub-types">Public Types</a> &#124;
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pub-attribs">Public Attributes</a> &#124;
<a href="struct_introdunction_to_algorithm_1_1_graph_algorithm_1_1_matrix_graph-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">IntrodunctionToAlgorithm::GraphAlgorithm::MatrixGraph&lt; N &gt; Struct Template Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>MatrixGraph：图的矩阵表示，算法导论22章22.1节  
 <a href="struct_introdunction_to_algorithm_1_1_graph_algorithm_1_1_matrix_graph.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="matrixgraph_8h_source.html">matrixgraph.h</a>&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-types"></a>
Public Types</h2></td></tr>
<tr class="memitem:ae00582b52cc9f015cb9b1b8f4d521776"><td class="memItemLeft" align="right" valign="top">typedef int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_introdunction_to_algorithm_1_1_graph_algorithm_1_1_matrix_graph.html#ae00582b52cc9f015cb9b1b8f4d521776">VIDType</a></td></tr>
<tr class="separator:ae00582b52cc9f015cb9b1b8f4d521776"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af2d243f2c1bb8a101aa3f71f469c64e8"><td class="memItemLeft" align="right" valign="top">typedef int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_introdunction_to_algorithm_1_1_graph_algorithm_1_1_matrix_graph.html#af2d243f2c1bb8a101aa3f71f469c64e8">EWeightType</a></td></tr>
<tr class="separator:af2d243f2c1bb8a101aa3f71f469c64e8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a73af3fee951b91b4f5c48422460f8c03"><td class="memItemLeft" align="right" valign="top">typedef std::tuple&lt; <a class="el" href="struct_introdunction_to_algorithm_1_1_graph_algorithm_1_1_matrix_graph.html#ae00582b52cc9f015cb9b1b8f4d521776">VIDType</a>, <a class="el" href="struct_introdunction_to_algorithm_1_1_graph_algorithm_1_1_matrix_graph.html#ae00582b52cc9f015cb9b1b8f4d521776">VIDType</a>, <a class="el" href="struct_introdunction_to_algorithm_1_1_graph_algorithm_1_1_matrix_graph.html#af2d243f2c1bb8a101aa3f71f469c64e8">EWeightType</a> &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_introdunction_to_algorithm_1_1_graph_algorithm_1_1_matrix_graph.html#a73af3fee951b91b4f5c48422460f8c03">EdgeTupleType</a></td></tr>
<tr class="separator:a73af3fee951b91b4f5c48422460f8c03"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a13dd6a7edd0776390b042302c56519cd"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_introdunction_to_algorithm_1_1_graph_algorithm_1_1_matrix_graph.html#a13dd6a7edd0776390b042302c56519cd">MatrixGraph</a> (<a class="el" href="struct_introdunction_to_algorithm_1_1_graph_algorithm_1_1_matrix_graph.html#af2d243f2c1bb8a101aa3f71f469c64e8">EWeightType</a> val)</td></tr>
<tr class="memdesc:a13dd6a7edd0776390b042302c56519cd"><td class="mdescLeft">&#160;</td><td class="mdescRight">显式构造函数，指定<code>invalid_weight</code>  <a href="#a13dd6a7edd0776390b042302c56519cd">More...</a><br /></td></tr>
<tr class="separator:a13dd6a7edd0776390b042302c56519cd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a46eaefb35a7150323befe5156b40c4e6"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_introdunction_to_algorithm_1_1_graph_algorithm_1_1_matrix_graph.html#a46eaefb35a7150323befe5156b40c4e6">MatrixGraph</a> ()</td></tr>
<tr class="memdesc:a46eaefb35a7150323befe5156b40c4e6"><td class="mdescLeft">&#160;</td><td class="mdescRight">默认构造函数，指定<code>invalid_weight</code>为0  <a href="#a46eaefb35a7150323befe5156b40c4e6">More...</a><br /></td></tr>
<tr class="separator:a46eaefb35a7150323befe5156b40c4e6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aed3562e551c77ff7d80eae0e454d720e"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_introdunction_to_algorithm_1_1_graph_algorithm_1_1_matrix_graph.html#aed3562e551c77ff7d80eae0e454d720e">add_edge</a> (const <a class="el" href="struct_introdunction_to_algorithm_1_1_graph_algorithm_1_1_matrix_graph.html#a73af3fee951b91b4f5c48422460f8c03">EdgeTupleType</a> &amp;edge_tuple)</td></tr>
<tr class="memdesc:aed3562e551c77ff7d80eae0e454d720e"><td class="mdescLeft">&#160;</td><td class="mdescRight">add_edge:添加一条边  <a href="#aed3562e551c77ff7d80eae0e454d720e">More...</a><br /></td></tr>
<tr class="separator:aed3562e551c77ff7d80eae0e454d720e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7f2b13ccc3c080c736a703a7655dbcd0"><td class="memTemplParams" colspan="2">template&lt;typename Iteator &gt; </td></tr>
<tr class="memitem:a7f2b13ccc3c080c736a703a7655dbcd0"><td class="memTemplItemLeft" align="right" valign="top">void&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="struct_introdunction_to_algorithm_1_1_graph_algorithm_1_1_matrix_graph.html#a7f2b13ccc3c080c736a703a7655dbcd0">add_edges</a> (const Iteator &amp;begin, const Iteator &amp;end)</td></tr>
<tr class="memdesc:a7f2b13ccc3c080c736a703a7655dbcd0"><td class="mdescLeft">&#160;</td><td class="mdescRight">add_edges:添加一组边  <a href="#a7f2b13ccc3c080c736a703a7655dbcd0">More...</a><br /></td></tr>
<tr class="separator:a7f2b13ccc3c080c736a703a7655dbcd0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa01c8df41f0948dd3116c9d6d8dd80d5"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_introdunction_to_algorithm_1_1_graph_algorithm_1_1_matrix_graph.html#aa01c8df41f0948dd3116c9d6d8dd80d5">adjust_edge</a> (<a class="el" href="struct_introdunction_to_algorithm_1_1_graph_algorithm_1_1_matrix_graph.html#ae00582b52cc9f015cb9b1b8f4d521776">VIDType</a> id1, <a class="el" href="struct_introdunction_to_algorithm_1_1_graph_algorithm_1_1_matrix_graph.html#ae00582b52cc9f015cb9b1b8f4d521776">VIDType</a> id2, <a class="el" href="struct_introdunction_to_algorithm_1_1_graph_algorithm_1_1_matrix_graph.html#af2d243f2c1bb8a101aa3f71f469c64e8">EWeightType</a> wt)</td></tr>
<tr class="memdesc:aa01c8df41f0948dd3116c9d6d8dd80d5"><td class="mdescLeft">&#160;</td><td class="mdescRight">adjust_edge:修改一条边的权重  <a href="#aa01c8df41f0948dd3116c9d6d8dd80d5">More...</a><br /></td></tr>
<tr class="separator:aa01c8df41f0948dd3116c9d6d8dd80d5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa8d8cbe8e7d912681162c9d45ace5af2"><td class="memItemLeft" align="right" valign="top">const std::vector&lt; <a class="el" href="struct_introdunction_to_algorithm_1_1_graph_algorithm_1_1_matrix_graph.html#a73af3fee951b91b4f5c48422460f8c03">EdgeTupleType</a> &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_introdunction_to_algorithm_1_1_graph_algorithm_1_1_matrix_graph.html#aa8d8cbe8e7d912681162c9d45ace5af2">edge_tuples</a> () const </td></tr>
<tr class="memdesc:aa8d8cbe8e7d912681162c9d45ace5af2"><td class="mdescLeft">&#160;</td><td class="mdescRight">edge_tuples:返回图中所有边的三元素元组集合，这里集合采用<code>std::vector&lt;std::tuple&lt;VIDType,VIDType,EWeightType&gt;&gt;</code>  <a href="#aa8d8cbe8e7d912681162c9d45ace5af2">More...</a><br /></td></tr>
<tr class="separator:aa8d8cbe8e7d912681162c9d45ace5af2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:adb7bcbdcc424af76ccb04225a3c83f04"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_introdunction_to_algorithm_1_1_graph_algorithm_1_1_matrix_graph.html#adb7bcbdcc424af76ccb04225a3c83f04">has_edge</a> (<a class="el" href="struct_introdunction_to_algorithm_1_1_graph_algorithm_1_1_matrix_graph.html#ae00582b52cc9f015cb9b1b8f4d521776">VIDType</a> id_from, <a class="el" href="struct_introdunction_to_algorithm_1_1_graph_algorithm_1_1_matrix_graph.html#ae00582b52cc9f015cb9b1b8f4d521776">VIDType</a> id_to) const </td></tr>
<tr class="memdesc:adb7bcbdcc424af76ccb04225a3c83f04"><td class="mdescLeft">&#160;</td><td class="mdescRight">has_edge:返回图中指定顶点之间是否存在边  <a href="#adb7bcbdcc424af76ccb04225a3c83f04">More...</a><br /></td></tr>
<tr class="separator:adb7bcbdcc424af76ccb04225a3c83f04"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab194457255cc4ad47eaa91d630b4d3bb"><td class="memItemLeft" align="right" valign="top"><a class="el" href="struct_introdunction_to_algorithm_1_1_graph_algorithm_1_1_matrix_graph.html#af2d243f2c1bb8a101aa3f71f469c64e8">EWeightType</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_introdunction_to_algorithm_1_1_graph_algorithm_1_1_matrix_graph.html#ab194457255cc4ad47eaa91d630b4d3bb">weight</a> (<a class="el" href="struct_introdunction_to_algorithm_1_1_graph_algorithm_1_1_matrix_graph.html#ae00582b52cc9f015cb9b1b8f4d521776">VIDType</a> id_from, <a class="el" href="struct_introdunction_to_algorithm_1_1_graph_algorithm_1_1_matrix_graph.html#ae00582b52cc9f015cb9b1b8f4d521776">VIDType</a> id_to) const </td></tr>
<tr class="memdesc:ab194457255cc4ad47eaa91d630b4d3bb"><td class="mdescLeft">&#160;</td><td class="mdescRight">weight:返回图中指定顶点之间的边的权重  <a href="#ab194457255cc4ad47eaa91d630b4d3bb">More...</a><br /></td></tr>
<tr class="separator:ab194457255cc4ad47eaa91d630b4d3bb"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-attribs"></a>
Public Attributes</h2></td></tr>
<tr class="memitem:a7808a578d4c380baa6de5d4b23bcc84f"><td class="memItemLeft" align="right" valign="top">std::array&lt; std::array&lt; <a class="el" href="struct_introdunction_to_algorithm_1_1_graph_algorithm_1_1_matrix_graph.html#af2d243f2c1bb8a101aa3f71f469c64e8">EWeightType</a>, N &gt;, N &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_introdunction_to_algorithm_1_1_graph_algorithm_1_1_matrix_graph.html#a7808a578d4c380baa6de5d4b23bcc84f">matrix</a></td></tr>
<tr class="separator:a7808a578d4c380baa6de5d4b23bcc84f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a015ceb5dcacd9d1bc1e67e5cf331aa7f"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="struct_introdunction_to_algorithm_1_1_graph_algorithm_1_1_matrix_graph.html#af2d243f2c1bb8a101aa3f71f469c64e8">EWeightType</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_introdunction_to_algorithm_1_1_graph_algorithm_1_1_matrix_graph.html#a015ceb5dcacd9d1bc1e67e5cf331aa7f">invalid_weight</a></td></tr>
<tr class="separator:a015ceb5dcacd9d1bc1e67e5cf331aa7f"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><h3>template&lt;unsigned N&gt;<br />
struct IntrodunctionToAlgorithm::GraphAlgorithm::MatrixGraph&lt; N &gt;</h3>

<p>MatrixGraph：图的矩阵表示，算法导论22章22.1节 </p>
<p>图的矩阵主要包含两个数据：</p>
<ul>
<li><code>matrix</code>：一个矩阵，类型为<code>std::array&lt;std::array&lt;EWeightType,N&gt;, N&gt;</code>，为<code>N*N</code>大小：</li>
<li><code>invalid_weight</code>：无效权重。当矩阵中<code>r</code>行<code>c</code>列数据为该值时，表示编号为<code>r</code>与<code>c</code>的顶点之间没有连接</li>
</ul>
<p>为了便于计算，这里并不管理边和顶点，只是维护矩阵。边、顶点与矩阵的同步由使用者确保。 </p>

<p>Definition at line <a class="el" href="matrixgraph_8h_source.html#l00019">19</a> of file <a class="el" href="matrixgraph_8h_source.html">matrixgraph.h</a>.</p>
</div><h2 class="groupheader">Member Typedef Documentation</h2>
<a class="anchor" id="a73af3fee951b91b4f5c48422460f8c03"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;unsigned N&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">typedef std::tuple&lt;<a class="el" href="struct_introdunction_to_algorithm_1_1_graph_algorithm_1_1_matrix_graph.html#ae00582b52cc9f015cb9b1b8f4d521776">VIDType</a>,<a class="el" href="struct_introdunction_to_algorithm_1_1_graph_algorithm_1_1_matrix_graph.html#ae00582b52cc9f015cb9b1b8f4d521776">VIDType</a>,<a class="el" href="struct_introdunction_to_algorithm_1_1_graph_algorithm_1_1_matrix_graph.html#af2d243f2c1bb8a101aa3f71f469c64e8">EWeightType</a>&gt; <a class="el" href="struct_introdunction_to_algorithm_1_1_graph_algorithm_1_1_matrix_graph.html">IntrodunctionToAlgorithm::GraphAlgorithm::MatrixGraph</a>&lt; N &gt;::<a class="el" href="struct_introdunction_to_algorithm_1_1_graph_algorithm_1_1_matrix_graph.html#a73af3fee951b91b4f5c48422460f8c03">EdgeTupleType</a></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>边的三元素（顶点1编号，顶点2编号，权重)组成的元组 </p>

<p>Definition at line <a class="el" href="matrixgraph_8h_source.html#l00023">23</a> of file <a class="el" href="matrixgraph_8h_source.html">matrixgraph.h</a>.</p>

</div>
</div>
<a class="anchor" id="af2d243f2c1bb8a101aa3f71f469c64e8"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;unsigned N&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">typedef int <a class="el" href="struct_introdunction_to_algorithm_1_1_graph_algorithm_1_1_matrix_graph.html">IntrodunctionToAlgorithm::GraphAlgorithm::MatrixGraph</a>&lt; N &gt;::<a class="el" href="struct_introdunction_to_algorithm_1_1_graph_algorithm_1_1_matrix_graph.html#af2d243f2c1bb8a101aa3f71f469c64e8">EWeightType</a></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>权重的类型 </p>

<p>Definition at line <a class="el" href="matrixgraph_8h_source.html#l00022">22</a> of file <a class="el" href="matrixgraph_8h_source.html">matrixgraph.h</a>.</p>

</div>
</div>
<a class="anchor" id="ae00582b52cc9f015cb9b1b8f4d521776"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;unsigned N&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">typedef int <a class="el" href="struct_introdunction_to_algorithm_1_1_graph_algorithm_1_1_matrix_graph.html">IntrodunctionToAlgorithm::GraphAlgorithm::MatrixGraph</a>&lt; N &gt;::<a class="el" href="struct_introdunction_to_algorithm_1_1_graph_algorithm_1_1_matrix_graph.html#ae00582b52cc9f015cb9b1b8f4d521776">VIDType</a></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>顶点编号的类型 </p>

<p>Definition at line <a class="el" href="matrixgraph_8h_source.html#l00021">21</a> of file <a class="el" href="matrixgraph_8h_source.html">matrixgraph.h</a>.</p>

</div>
</div>
<h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="a13dd6a7edd0776390b042302c56519cd"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;unsigned N&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="struct_introdunction_to_algorithm_1_1_graph_algorithm_1_1_matrix_graph.html">IntrodunctionToAlgorithm::GraphAlgorithm::MatrixGraph</a>&lt; N &gt;::<a class="el" href="struct_introdunction_to_algorithm_1_1_graph_algorithm_1_1_matrix_graph.html">MatrixGraph</a> </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_introdunction_to_algorithm_1_1_graph_algorithm_1_1_matrix_graph.html#af2d243f2c1bb8a101aa3f71f469c64e8">EWeightType</a>&#160;</td>
          <td class="paramname"><em>val</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">explicit</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>显式构造函数，指定<code>invalid_weight</code> </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">val:无效权重值</td><td></td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="matrixgraph_8h_source.html#l00029">29</a> of file <a class="el" href="matrixgraph_8h_source.html">matrixgraph.h</a>.</p>

</div>
</div>
<a class="anchor" id="a46eaefb35a7150323befe5156b40c4e6"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;unsigned N&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="struct_introdunction_to_algorithm_1_1_graph_algorithm_1_1_matrix_graph.html">IntrodunctionToAlgorithm::GraphAlgorithm::MatrixGraph</a>&lt; N &gt;::<a class="el" href="struct_introdunction_to_algorithm_1_1_graph_algorithm_1_1_matrix_graph.html">MatrixGraph</a> </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>默认构造函数，指定<code>invalid_weight</code>为0 </p>

<p>Definition at line <a class="el" href="matrixgraph_8h_source.html#l00036">36</a> of file <a class="el" href="matrixgraph_8h_source.html">matrixgraph.h</a>.</p>

</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a class="anchor" id="aed3562e551c77ff7d80eae0e454d720e"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;unsigned N&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="struct_introdunction_to_algorithm_1_1_graph_algorithm_1_1_matrix_graph.html">IntrodunctionToAlgorithm::GraphAlgorithm::MatrixGraph</a>&lt; N &gt;::add_edge </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="struct_introdunction_to_algorithm_1_1_graph_algorithm_1_1_matrix_graph.html#a73af3fee951b91b4f5c48422460f8c03">EdgeTupleType</a> &amp;&#160;</td>
          <td class="paramname"><em>edge_tuple</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>add_edge:添加一条边 </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">edge_tuple:一条边的三元素元组</td><td>为了便于计算，添加边时并不是添加<code><a class="el" href="struct_introdunction_to_algorithm_1_1_graph_algorithm_1_1_edge.html" title="Edge：图的边，算法导论22章22.1节 ">Edge</a></code>类型，而是<code>std::tuple&lt;VIDType,VIDType,EWeightType&gt;</code>类型的值。</td></tr>
  </table>
  </dd>
</dl>
<p>如果指定节点之间的边已经存在，则抛出<code>std::invalid_argument</code>异常 </p><blockquote class="doxtable">
<p>要求边的顶点均在<code>[0,N)</code>这个半闭半开区间。如果任何一个值超过该区间则认为顶点<code>id</code>无效，直接返回而不作添加</p>
</blockquote>

<p>Definition at line <a class="el" href="matrixgraph_8h_source.html#l00048">48</a> of file <a class="el" href="matrixgraph_8h_source.html">matrixgraph.h</a>.</p>

</div>
</div>
<a class="anchor" id="a7f2b13ccc3c080c736a703a7655dbcd0"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;unsigned N&gt; </div>
<div class="memtemplate">
template&lt;typename Iteator &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="struct_introdunction_to_algorithm_1_1_graph_algorithm_1_1_matrix_graph.html">IntrodunctionToAlgorithm::GraphAlgorithm::MatrixGraph</a>&lt; N &gt;::add_edges </td>
          <td>(</td>
          <td class="paramtype">const Iteator &amp;&#160;</td>
          <td class="paramname"><em>begin</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const Iteator &amp;&#160;</td>
          <td class="paramname"><em>end</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>add_edges:添加一组边 </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">begin:边容器的起始迭代器</td><td></td></tr>
    <tr><td class="paramname">end:边容器的终止迭代器</td><td>为了便于计算，添加边时并不是添加<code><a class="el" href="struct_introdunction_to_algorithm_1_1_graph_algorithm_1_1_edge.html" title="Edge：图的边，算法导论22章22.1节 ">Edge</a></code>类型，而是<code>std::tuple&lt;VIDType,VIDType,EWeightType&gt;</code>类型的值</td></tr>
  </table>
  </dd>
</dl>
<p>如果指定节点之间的边已经存在，则抛出<code>std::invalid_argument</code>异常 </p><blockquote class="doxtable">
<p>要求边的顶点均在<code>[0,N)</code>这个半闭半开区间。如果任何一个值超过该区间则认为顶点<code>id</code>无效，直接返回而不作添加</p>
</blockquote>

<p>Definition at line <a class="el" href="matrixgraph_8h_source.html#l00069">69</a> of file <a class="el" href="matrixgraph_8h_source.html">matrixgraph.h</a>.</p>

</div>
</div>
<a class="anchor" id="aa01c8df41f0948dd3116c9d6d8dd80d5"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;unsigned N&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="struct_introdunction_to_algorithm_1_1_graph_algorithm_1_1_matrix_graph.html">IntrodunctionToAlgorithm::GraphAlgorithm::MatrixGraph</a>&lt; N &gt;::adjust_edge </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_introdunction_to_algorithm_1_1_graph_algorithm_1_1_matrix_graph.html#ae00582b52cc9f015cb9b1b8f4d521776">VIDType</a>&#160;</td>
          <td class="paramname"><em>id1</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="struct_introdunction_to_algorithm_1_1_graph_algorithm_1_1_matrix_graph.html#ae00582b52cc9f015cb9b1b8f4d521776">VIDType</a>&#160;</td>
          <td class="paramname"><em>id2</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="struct_introdunction_to_algorithm_1_1_graph_algorithm_1_1_matrix_graph.html#af2d243f2c1bb8a101aa3f71f469c64e8">EWeightType</a>&#160;</td>
          <td class="paramname"><em>wt</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>adjust_edge:修改一条边的权重 </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">id1:待修改边的第一个顶点</td><td></td></tr>
    <tr><td class="paramname">id2:待修改边的第二个顶点</td><td></td></tr>
    <tr><td class="paramname">wt:新的权重</td><td>修改顶点<code>id1</code>和<code>id2</code>直接的边的权重为<code>wt</code>。如果指定结点之间的边不存在，则抛出<code>std::invalid_argument</code>异常。 <blockquote class="doxtable">
<p>要求<code>id1</code>和<code>id2</code>均在<code>[0,N)</code>这个半闭半开区间。如果任何一个值超过该区间则认为顶点<code>id</code>无效，直接返回而不作权重修改</p>
</blockquote>
</td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="matrixgraph_8h_source.html#l00090">90</a> of file <a class="el" href="matrixgraph_8h_source.html">matrixgraph.h</a>.</p>

</div>
</div>
<a class="anchor" id="aa8d8cbe8e7d912681162c9d45ace5af2"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;unsigned N&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">const std::vector&lt;<a class="el" href="struct_introdunction_to_algorithm_1_1_graph_algorithm_1_1_matrix_graph.html#a73af3fee951b91b4f5c48422460f8c03">EdgeTupleType</a>&gt; <a class="el" href="struct_introdunction_to_algorithm_1_1_graph_algorithm_1_1_matrix_graph.html">IntrodunctionToAlgorithm::GraphAlgorithm::MatrixGraph</a>&lt; N &gt;::edge_tuples </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>edge_tuples:返回图中所有边的三元素元组集合，这里集合采用<code>std::vector&lt;std::tuple&lt;VIDType,VIDType,EWeightType&gt;&gt;</code> </p>
<dl class="section return"><dt>Returns</dt><dd>:图中所有边的三元素元组集合 </dd></dl>

<p>Definition at line <a class="el" href="matrixgraph_8h_source.html#l00103">103</a> of file <a class="el" href="matrixgraph_8h_source.html">matrixgraph.h</a>.</p>

</div>
</div>
<a class="anchor" id="adb7bcbdcc424af76ccb04225a3c83f04"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;unsigned N&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">bool <a class="el" href="struct_introdunction_to_algorithm_1_1_graph_algorithm_1_1_matrix_graph.html">IntrodunctionToAlgorithm::GraphAlgorithm::MatrixGraph</a>&lt; N &gt;::has_edge </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_introdunction_to_algorithm_1_1_graph_algorithm_1_1_matrix_graph.html#ae00582b52cc9f015cb9b1b8f4d521776">VIDType</a>&#160;</td>
          <td class="paramname"><em>id_from</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="struct_introdunction_to_algorithm_1_1_graph_algorithm_1_1_matrix_graph.html#ae00582b52cc9f015cb9b1b8f4d521776">VIDType</a>&#160;</td>
          <td class="paramname"><em>id_to</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>has_edge:返回图中指定顶点之间是否存在边 </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">id_from</td><td>第一个顶点的<code>id</code> </td></tr>
    <tr><td class="paramname">id_to</td><td>第二个顶点的<code>id</code> </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>:第一个顶点和第二个顶点之间是否存在边</dd></dl>
<ul>
<li>当<code>id_from</code>与<code>id_to</code>无效时，抛出异常 &gt;这里的无效值得是<code>id_from</code>、<code>id_to</code>不在区间<code>[0,N)</code>之间</li>
<li>当<code>id_from</code>与<code>id_to</code>之间有边时，返回<code>true</code></li>
<li>当<code>id_from</code>与<code>id_to</code>之间没有边时，返回<code>false</code> </li>
</ul>

<p>Definition at line <a class="el" href="matrixgraph_8h_source.html#l00127">127</a> of file <a class="el" href="matrixgraph_8h_source.html">matrixgraph.h</a>.</p>

</div>
</div>
<a class="anchor" id="ab194457255cc4ad47eaa91d630b4d3bb"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;unsigned N&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="struct_introdunction_to_algorithm_1_1_graph_algorithm_1_1_matrix_graph.html#af2d243f2c1bb8a101aa3f71f469c64e8">EWeightType</a> <a class="el" href="struct_introdunction_to_algorithm_1_1_graph_algorithm_1_1_matrix_graph.html">IntrodunctionToAlgorithm::GraphAlgorithm::MatrixGraph</a>&lt; N &gt;::weight </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_introdunction_to_algorithm_1_1_graph_algorithm_1_1_matrix_graph.html#ae00582b52cc9f015cb9b1b8f4d521776">VIDType</a>&#160;</td>
          <td class="paramname"><em>id_from</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="struct_introdunction_to_algorithm_1_1_graph_algorithm_1_1_matrix_graph.html#ae00582b52cc9f015cb9b1b8f4d521776">VIDType</a>&#160;</td>
          <td class="paramname"><em>id_to</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>weight:返回图中指定顶点之间的边的权重 </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">id_from</td><td>第一个顶点的<code>id</code> </td></tr>
    <tr><td class="paramname">id_to</td><td>第二个顶点的<code>id</code> </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>:第一个顶点和第二个顶点之间的边的权重</dd></dl>
<p>当且仅当<code>id_from</code>与<code>id_to</code>之间存在边时返回该边的权重。其他情况下都会抛出<code>std::invalid_argument</code>异常</p>
<ul>
<li>当<code>id_from</code>与<code>id_to</code>无效时，抛出异常 &gt;这里的无效值得是<code>id_from</code>、<code>id_to</code>不在区间<code>[0,N)</code>之间</li>
<li>当<code>id_from</code>与<code>id_to</code>之间无边时，抛出异常 </li>
</ul>

<p>Definition at line <a class="el" href="matrixgraph_8h_source.html#l00148">148</a> of file <a class="el" href="matrixgraph_8h_source.html">matrixgraph.h</a>.</p>

</div>
</div>
<h2 class="groupheader">Member Data Documentation</h2>
<a class="anchor" id="a015ceb5dcacd9d1bc1e67e5cf331aa7f"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;unsigned N&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">const <a class="el" href="struct_introdunction_to_algorithm_1_1_graph_algorithm_1_1_matrix_graph.html#af2d243f2c1bb8a101aa3f71f469c64e8">EWeightType</a> <a class="el" href="struct_introdunction_to_algorithm_1_1_graph_algorithm_1_1_matrix_graph.html">IntrodunctionToAlgorithm::GraphAlgorithm::MatrixGraph</a>&lt; N &gt;::invalid_weight</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>无效权重，是一个const值，一旦图被初始化之后就无法改变 </p>

<p>Definition at line <a class="el" href="matrixgraph_8h_source.html#l00160">160</a> of file <a class="el" href="matrixgraph_8h_source.html">matrixgraph.h</a>.</p>

</div>
</div>
<a class="anchor" id="a7808a578d4c380baa6de5d4b23bcc84f"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;unsigned N&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">std::array&lt;std::array&lt;<a class="el" href="struct_introdunction_to_algorithm_1_1_graph_algorithm_1_1_matrix_graph.html#af2d243f2c1bb8a101aa3f71f469c64e8">EWeightType</a>,N&gt;, N&gt; <a class="el" href="struct_introdunction_to_algorithm_1_1_graph_algorithm_1_1_matrix_graph.html">IntrodunctionToAlgorithm::GraphAlgorithm::MatrixGraph</a>&lt; N &gt;::matrix</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>图的矩阵 </p>

<p>Definition at line <a class="el" href="matrixgraph_8h_source.html#l00159">159</a> of file <a class="el" href="matrixgraph_8h_source.html">matrixgraph.h</a>.</p>

</div>
</div>
<hr/>The documentation for this struct was generated from the following file:<ul>
<li>src/graph_algorithms/basic_graph/matrix_graph/<a class="el" href="matrixgraph_8h_source.html">matrixgraph.h</a></li>
</ul>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="namespace_introdunction_to_algorithm.html">IntrodunctionToAlgorithm</a></li><li class="navelem"><a class="el" href="namespace_introdunction_to_algorithm_1_1_graph_algorithm.html">GraphAlgorithm</a></li><li class="navelem"><a class="el" href="struct_introdunction_to_algorithm_1_1_graph_algorithm_1_1_matrix_graph.html">MatrixGraph</a></li>
    <li class="footer">Generated by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.10 </li>
  </ul>
</div>
</body>
</html>
